package com.rmy.publish.service.impl;

import java.util.List;
import com.rmy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rmy.publish.mapper.MipsControllerInfoMapper;
import com.rmy.publish.domain.MipsControllerInfo;
import com.rmy.publish.service.IMipsControllerInfoService;

/**
 * 控件信息Service业务层处理
 *
 * @author rmy
 * @date 2023-05-26
 */
@Service
public class MipsControllerInfoServiceImpl implements IMipsControllerInfoService
{
    @Autowired
    private MipsControllerInfoMapper mipsControllerInfoMapper;

    /**
     * 查询控件信息
     *
     * @param controllerId 控件信息主键
     * @return 控件信息
     */
    @Override
    public MipsControllerInfo selectMipsControllerInfoByControllerId(Long controllerId)
    {
        return mipsControllerInfoMapper.selectMipsControllerInfoByControllerId(controllerId);
    }

    /**
     * 查询控件信息列表
     *
     * @param mipsControllerInfo 控件信息
     * @return 控件信息
     */
    @Override
    public List<MipsControllerInfo> selectMipsControllerInfoList(MipsControllerInfo mipsControllerInfo)
    {
        return mipsControllerInfoMapper.selectMipsControllerInfoList(mipsControllerInfo);
    }

    /**
     * 新增控件信息
     *
     * @param mipsControllerInfo 控件信息
     * @return 结果
     */
    @Override
    public int insertMipsControllerInfo(MipsControllerInfo mipsControllerInfo)
    {
        mipsControllerInfo.setCreateTime(DateUtils.getNowDate());
        return mipsControllerInfoMapper.insertMipsControllerInfo(mipsControllerInfo);
    }

    /**
     * 修改控件信息
     *
     * @param mipsControllerInfo 控件信息
     * @return 结果
     */
    @Override
    public int updateMipsControllerInfo(MipsControllerInfo mipsControllerInfo)
    {
        mipsControllerInfo.setUpdateTime(DateUtils.getNowDate());
        return mipsControllerInfoMapper.updateMipsControllerInfo(mipsControllerInfo);
    }

    /**
     * 批量删除控件信息
     *
     * @param controllerIds 需要删除的控件信息主键
     * @return 结果
     */
    @Override
    public int deleteMipsControllerInfoByControllerIds(Long[] controllerIds)
    {
        return mipsControllerInfoMapper.deleteMipsControllerInfoByControllerIds(controllerIds);
    }

    /**
     * 删除控件信息信息
     *
     * @param controllerId 控件信息主键
     * @return 结果
     */
    @Override
    public int deleteMipsControllerInfoByControllerId(Long controllerId)
    {
        return mipsControllerInfoMapper.deleteMipsControllerInfoByControllerId(controllerId);
    }

    @Override
    public int deleteMipsControllerInfoByPageId(Long pageId) {
        return mipsControllerInfoMapper.deleteMipsControllerInfoByPageId(pageId);
    }
}
